Skip to content

Conversation

mdedetrich
Copy link
Contributor

So getFirst for getting an attribute is deprecated and you are instead meant to use get however this does have a different behaviour change (i.e. getFirst will get the first found attribute where as get will get the most specific attribute).

Since we are now in the 1.1.x branch these kinds of behaviour changes are allowed

@mdedetrich
Copy link
Contributor Author

Okay so as I expected, we are actually relying on the behaviour of getFirst since the tests have started failing, will do some digging here.

@mdedetrich
Copy link
Contributor Author

@jrudolph @raboof So I had a quick look at this and I don't know what to do here, it seems like making getFirst deprecated was a mistake or maybe it should only be deprecated for public and not private inter-pekko use cases?

The whole reason why getFirst is necessary is so that the withSizeLimit directive works correctly with nested routes and while it is possible to remove the deprecation of getFirst without using get in doing so it would just involve copying the implementation of it which means its not really solving a problem?

@jrudolph
Copy link
Contributor

I know have come to the same conclusion at least once before. The whole attributes precedence story is quite complex and at the point back then I shied away from understanding enough of it to make sense of why we exactly depend on the previous behavior.

To make progress in pekko I'd be fine moving the get behavior into pekko-http until we find a workaround.

@pjfanning
Copy link
Member

@jrudolph it would be fine to copy over the getFirst code to this one place where we seem to need it

@mdedetrich
Copy link
Contributor Author

Question, why was getFirst even deprecated?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants